function generateDemoOrders(count) {
    const orders = [];
    const orderTypes = [
        "跨境直供（₽ 结算)",
        "国内批发（¥ 结算)",
        "跨境零售（€ 结算)",
        "代理采购（$ 结算)"
    ];
    const orderTypeValues = [1, 2, 3, 4];
    const statusOrders = [
        "商品在途",
        "已下单",
        "已发货",
        "已签收",
        "已取消",
        "处理中"
    ];
    const statusOrderValues = [1, 2, 3, 4, 5, 6];
    const goodsTypes = [
        "服装(非毛皮)",
        "电子产品",
        "家居用品",
        "玩具",
        "食品",
        "化妆品"
    ];
    const statusPayments = [
        "付款完成",
        "未付款",
        "部分付款",
        "退款中",
        "已退款"
    ];
    const statusPaymentValues = [1, 2, 3, 4, 5];
    const suppliers = [
        "Kids Tales实力旗舰店",
        "温州市瓯海潘桥辣妞童装店",
        "上海电子科技有限公司",
        "广州家居用品批发中心",
        "北京玩具进出口公司",
        "深圳美妆供应链"
    ];
    const logisticsCenters = ["永清", "上海", "广州", "深圳", "北京", "武汉"];
    const memberNames = [
        "КИФА-ТОРГ ООО",
        "Магазин Детских Товаров",
        "Текстильный Импорт",
        "Электронный Мир",
        "Дом и Домашний Уют"
    ];

    for (let i = 0; i < count; i++) {
        // 随机生成多个供应商ID和名称
        const randomSupplierCount = Math.floor(Math.random() * 3) + 1;
        const selectedSuppliers = [];
        const selectedSupplierIds = [];
        
        for (let j = 0; j < randomSupplierCount; j++) {
            const randomIndex = Math.floor(Math.random() * suppliers.length);
            if (!selectedSuppliers.includes(suppliers[randomIndex])) {
                selectedSuppliers.push(suppliers[randomIndex]);
                selectedSupplierIds.push(2000 + randomIndex * 100 + Math.floor(Math.random() * 100));
            }
        }

        // 生成随机日期（过去3个月内）
        const today = new Date();
        const randomDays = Math.floor(Math.random() * 90);
        const randomDate = new Date(today);
        randomDate.setDate(today.getDate() - randomDays);
        const formattedDate = `${randomDate.getFullYear()}-${String(randomDate.getMonth() + 1).padStart(2, '0')}-${String(randomDate.getDate()).padStart(2, '0')} ${String(randomDate.getHours()).padStart(2, '0')}:${String(randomDate.getMinutes()).padStart(2, '0')}`;

        // 生成随机金额（1000-100000之间）
        const randomAmount = Math.floor(Math.random() * 99000) + 1000;
        const formattedAmount = `${randomAmount.toLocaleString()} ₽`;

        // 随机选择状态和类型
        const orderTypeIndex = Math.floor(Math.random() * orderTypes.length);
        const statusOrderIndex = Math.floor(Math.random() * statusOrders.length);
        const goodsTypeIndex = Math.floor(Math.random() * goodsTypes.length);
        const statusPaymentIndex = Math.floor(Math.random() * statusPayments.length);
        const logisticsCenterIndex = Math.floor(Math.random() * logisticsCenters.length);
        const memberNameIndex = Math.floor(Math.random() * memberNames.length);

        // 生成订单
        const order = {
            "order_id": 96847 + i,
            "order_type": orderTypes[orderTypeIndex],
            "supplier_id": selectedSupplierIds.join(','),
            "order_type_val": orderTypeValues[orderTypeIndex],
            "is_fcl_val": Math.random() > 0.5 ? 1 : -1,
            "is_bei": Math.random() > 0.7 ? 1 : 0,
            "show_settlement_button": Math.random() > 0.8,
            "first": Math.random() > 0.9 ? 1 : 0,
            "cancel": statusOrderIndex === 4 ? 1 : 0, // 如果状态是已取消，则cancel为1
            "order_no": 7702256845216 + i,
            "created_at": formattedDate,
            "order_no_1c": `КИУТ-${String(1876 + i).padStart(6, '0')}`,
            "manager_1c": ["Шадурская Виктория", "Иванов Иван", "Петров Петр", "Сидоров Сергей"][Math.floor(Math.random() * 4)],
            "amount_final": formattedAmount,
            "status_order": statusOrders[statusOrderIndex],
            "status_order_val": statusOrderValues[statusOrderIndex],
            "goods_type": goodsTypes[goodsTypeIndex],
            "member_name": memberNames[memberNameIndex],
            "member_email": `client${i}@example.com`,
            "member_mobile": `+375${Math.floor(100000000 + Math.random() * 900000000)}`,
            "status_payment": statusPayments[statusPaymentIndex],
            "status_payment_val": statusPaymentValues[statusPaymentIndex],
            "supplier": selectedSuppliers.join('、'),
            "payment_name": memberNames[memberNameIndex],
            "tax_code": `${Math.floor(100000000 + Math.random() * 900000000)}`,
            "transport_company_id": Math.random() > 0.3 ? `${Math.floor(100 + Math.random() * 900)}` : "",
            "consignee_name": memberNames[memberNameIndex],
            "address": Math.random() > 0.2 ? `ул. ${["Ленина", "Пушкина", "Карла Маркса", "Советская"][Math.floor(Math.random() * 4)]} ${Math.floor(1 + Math.random() * 100)}, ${["Минск", "Москва", "Киев", "Вильнюс"][Math.floor(Math.random() * 4)]}` : "",
            "logistics_warehouse": Math.random() > 0.6 ? `仓库${Math.floor(1 + Math.random() * 20)}` : "",
            "logistics_center_id": logisticsCenters[logisticsCenterIndex],
            "remark": Math.random() > 0.8 ? "客户要求加急发货" : "",
            "remark_supplier": Math.random() > 0.7 ? "已备货，等待出库" : "",
            "remark_qifa": Math.random() > 0.9 ? "注意检查包装" : "",
            "cancel_reason": statusOrderIndex === 4 ? ["客户取消", "库存不足", "价格问题", "地址错误"][Math.floor(Math.random() * 4)] : ""
        };

        orders.push(order);
    }

    return orders;
}

// 生成500条演示数据
const demoOrders = generateDemoOrders(500);

// 输出结果（在浏览器控制台或Node.js环境中）
console.log(JSON.stringify(demoOrders, null, 2));
